// 封装本地存储数据与读取数据方法
// 存储数据
export const SET_TOKEN = (token: string) => {
  sessionStorage.setItem('TOKEN', token)
}
// 获取数据
export const GET_TOKEN = () => {
  return sessionStorage.getItem('TOKEN')
}
// 删除数据
export const REMOVE_TOKEN = () => {
  return sessionStorage.removeItem('TOKEN')
}

// 存储用户数据
export const SET_USERINFO = (userinfo: any) => {
  sessionStorage.setItem('USERINFO', JSON.stringify(userinfo))
}
// 获取用户数据
export const GET_USERINFO = () => {
  return JSON.parse((sessionStorage.getItem('USERINFO') as string))
}
// 删除用户数据
export const REMOVE_USERINFO = () => {
  return sessionStorage.removeItem('USERINFO')
}

// 存储菜单数据
export const SET_MENUINFO = (menuinfo: any) => {
  sessionStorage.setItem('MENUINFO', JSON.stringify(menuinfo))
}
// 获取菜单数据
export const GET_MENUINFO = () => {
  return JSON.parse((sessionStorage.getItem('MENUINFO') as string))
}
// 删除菜单数据
export const REMOVE_MENUINFO = () => {
  return sessionStorage.removeItem('MENUINFO')
}